Skip to content

Conversation

@pierresouchay
Copy link

@pierresouchay pierresouchay commented Dec 11, 2025

Context: As explained in #1228, when database is very slow to answer, every call to prometheus exporter might consume a new connection and possibly consume all available connections

Solution: Ensure a Context with a specified Timeout is specified, so the connection will end if duration of collection is too long

Will fix #1228

@pierresouchay pierresouchay force-pushed the limit_max_duration_of_postgresql_connections_to_avoid_using_too_many_connections branch 5 times, most recently from 76203d5 to f588ca8 Compare December 11, 2025 22:27
@pierresouchay pierresouchay changed the title Ensure collection returns within a specified delay Ensure collection of stats succeed in a predicatable delay to avoid exhausting PG connections Dec 11, 2025
@pierresouchay pierresouchay changed the title Ensure collection of stats succeed in a predicatable delay to avoid exhausting PG connections Ensure collection of stats succeed in a maximum duration to avoid exhausting PG connections Dec 11, 2025
@pierresouchay
Copy link
Author

@sysadmind I think I addressed all of your concerns, thank you very much for the review

Pierre SOUCHAY added 7 commits December 14, 2025 10:05
**Context**: As explained in prometheus-community#1228, when database is very slow to answer, every call to prometheus exporter might consume a new connection and possibly consume all available connections

**Solution**: Ensure a Context with a specified Timeout is specified, so the connection will end if duration of collection is too long

Signed-off-by: Pierre Souchay <pierre.souchay@pelico.io>
…should

Signed-off-by: Pierre Souchay <pierre.souchay@pelico.io>
…DME.md

Signed-off-by: Pierre SOUCHAY <pierre.souchay@pelico.io>
Signed-off-by: Pierre SOUCHAY <pierre.souchay@pelico.io>
Signed-off-by: Pierre SOUCHAY <pierre.souchay@pelico.io>
Signed-off-by: Pierre SOUCHAY <pierre.souchay@pelico.io>
Signed-off-by: Pierre SOUCHAY <pierre.souchay@pelico.io>
@pierresouchay pierresouchay force-pushed the limit_max_duration_of_postgresql_connections_to_avoid_using_too_many_connections branch from 6240c6f to ac7050d Compare December 14, 2025 09:06
@pierresouchay
Copy link
Author

@sysadmind I fixed your last concern about the test duration: I think we are good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

In case of database lock or low performance prometheus-exporer accumulates connections to the database

2 participants